﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <SCRIPT src="/jquery-1.7.2.min.js" type="text/javascript">
    </SCRIPT>
    <SCRIPT src="/jquery.tmpl.js" type="text/javascript">
    </SCRIPT>
</head>
<body>
    <div id="fromhtml"> </div>
    <script id="miantmpl" type="text/x-jquery-tmpl">
        <template>
            <div>
                {{each layoutitemlist}}
                <a-col :span="${span}">
                    {{each widgetForm.list}}
                    {{tmpl($value) '#panelcodetmpl'}}
                    {{/each}}
                </a-col>
                {{/each}}

                {{each layerlist}}
                {{tmpl($value) '#dialogcodetmpl'}}
                {{/each}}
            </div>
        </template>
    </script>
    <script id="panelcodetmpl" type="type/x-jquery-tmpl">
        {{if type=="gridPanel"}}

            {{each columns}}
            <a-col :span="24" {{html options.tagattr}}>
                {{tmpl($value) '#fromcodetmpl'}}
            </a-col>
            {{/each}}

        {{else type=="tabs"}}
            <a-col :span="24">
                <a-tabs default-active-key="1" default-active-key="${options.panelist.length>0?options.panelist[0].name:""}">
                    {{each options.panelist}}
                    <a-tab-pane tab="${title}"  key="${$index+1}"
                                  {{html options.tagattr}}>
                        <a-row type="flex">
                            {{each  columns}}
                                        {{tmpl($value) '#fromcodetmpl'}}
                            {{/each}}
                        </a-row>
                    </a-tab-pane>
                    {{/each}}
                </a-tabs>
            </a-col>
            {{else type=="collapse"}}
            <a-col :span="24">
                <a-collapse default-active-key="1" {{html options.tagattr}}>
                    {{each options.panelist}}
                    <a-collapse-panel key="${$index+1}" header="${title}">
                        <a-row type="flex">
                            {{each  columns}}
                                        {{tmpl($value) '#fromcodetmpl'}}
                            {{/each}}
                        </a-row>
                    </a-collapse-panel>
                    {{/each}}
                </a-collapse>
            </a-col>
            {{else}}
            {{/if}}
    </script>
    <script id="dialogcodetmpl" type="type/x-jquery-tmpl">
        <zhlDialog title="${title}"
                   ref="${options.idPrefix}"
                   width="${options.width.indexOf("%")<0&&options.width.indexOf("px")<0?(options.width+"px"):options.width}"
                   height=""
                   class="my-dialog">
                    <div style="min-height:${options.height.indexOf("%")<0 &&options.height.indexOf("px")<0?(options.height+"px"):options.height}">
                                                                                                 {{each list}}
                                                                                                 {{tmpl($value) '#panelcodetmpl'}}
                                                                                                 {{/each}}
                      </div>
           {{if options.layertype == 'center'}}
        <a-row class="filterbottom">
        <div class="operation">
        {{each options.buttons}}
                    <a-button
                      type="${options.butType}"
                      style="margin-right:10px"
                      size="${options.butsize}"
                      icon="${options.icon}"
        ${getevent($value)} {{html options.tagattr}}
                      >${ options.labelTitle }</a-button
                    >
        {{/each}}
                </div>  </div>
        {{/if}}
        </zhlDialog>
    </script>
    <script id="wmpDetailcodetmpl" type="type/x-jquery-tmpl">
         {{if type=="showno"}}
                {{else}}
                        <div slot="${dataIndex}" slot-scope="text, scope">
                            {{if  type=="input"}}
                            <a-input placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" maxlength="${options.dataLength}" ${getevent($data)} {{html options.tagattr}}></a-input>
                            {{else type == 'textarea'}}
                            <a-textarea auto-size
                                        rows="2"
                                        placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" maxlength="${options.dataLength}" ${getevent($data)} {{html options.tagattr}}>
                            </a-textarea>
                            {{else type == 'select'}}
                            <a-select  style="width: 100%;" placeholder="请选择${ title }" ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                                 {{if options.isRemote==true}}
                                   <a-select-option  v-for="(item,index) in controlData.${dataIndex}" :key="index"
                                              :value="item.${options.labelValue}" >
                                ${"{{item."+options.labelText}}}
                                    </a-select-option>
                                {{else}}
                                  {{each options.options}}
                                    <a-select-option value="${value}">
                                        ${label}
                                    </a-select-option>
                                    {{/each}}
                                {{/if}}
                            </a-select>
                            {{else type == 'date'}}
                            {{if options.modeltype == 'date'}}
                            <a-date-picker placeholder="${options.placeholder}"
                                           format="${options.format}"
                                           ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />
                            {{else options.modeltype == 'month'}}
                            <a-month-picker placeholder="${options.placeholder}"
                                            format="yyyy-MM"
                                            ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />
                            {{else options.modeltype == 'week'}}
                            <a-week-picker placeholder="${options.placeholder}"
                                           ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />
                            {{else options.modeltype == 'range'}}
                            <a-range-picker placeholder="${options.placeholder}"
                                            format="${options.format}"
                                            style="width:100%"
                                            ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />
                            {{/if}}
                            {{else type == 'radio'}}
                            <a-radio-group
                                           style="line-height:43px; display:block;" ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                                 {{if options.isRemote==true}}
                                       <a-radio  v-for="(item,index) in controlData.${dataIndex}" :key="index"
                                              :value="item.${options.labelValue}">
                                ${"{{item."+options.labelText}}}
                                    </a-radio>
                                 {{else}}
                                    {{each options.options}}
                                        <a-radio style="inline"
                                                     label="${value}" >${label}</a-radio>
                                        {{/each}}
                                {{/if}}
                            </a-radio-group>
                            {{else type == 'checkbox'}}
                            <a-checkbox-group
                                               style="line-height:43px;" ${options.disabled?"disabled":""} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                                  {{if options.isRemote==true}}
                                       <a-checkbox  v-for="(item,index) in controlData.${dataIndex}" :key="index"
                                              :value="item.${options.labelValue}">
                                ${"{{item."+options.labelText}}}
                                    </a-checkbox>
                                 {{else}}
                                    {{each options.options}}
                                        <a-checkbox style="inline"
                                                     label="${value}" >${label}</a-checkbox>
                                        {{/each}}
                                {{/if}}
                            </a-checkbox-group>
                            {{else type == 'editor'}}

                            {{else type == 'blank'}}

                            {{else type == 'rate'}}
                            <a-rate ${options.readonly?"readonly='true' ":" "} v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}}></a-rate>
                            {{else type == 'inputnumber'}}
                            <a-input-number ${options.disabled?"disabled":""}
                                             min="${options.min}"
                                             max="${options.max}"
                                             step="${options.step}"
                                             precision="${options.precision}" v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}}></a-input-number>
                            {{else type == 'timepicker'}}
                            <a-time-picker use12-hours
                                           format="${options.timeformat}"
                                           ${options.disabled?"disabled":""}
                                           minute-step="${options.minute}"
                                           second-step="${options.second}" v-model="scope.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />

                            {{else type == 'user'}}
                            <a-input-search placeholder="input search text" v-model="scope.${dataIndex}.text" {{html options.tagattr}} />
                            {{else type == 'department'}}
                            <input type="text" placeholder="" class="form-control" v-model="scope.${dataIndex}.text" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'project'}}
                            <input type="text" placeholder="" class="form-control" v-model="scope.${dataIndex}.text" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'cost'}}
                            <input type="text" placeholder="" class="form-control" v-model="scope.${dataIndex}.text" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'choose'}}
                            <input type="text" placeholder="" class="form-control" v-model="scope.${dataIndex}.text" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else  type == 'button' }}
                            {{each options.buttons}}
                        <a-button type="primary" style="margin-left:5px;" plain ${getevent($value)} {{html options.tagattr}}>
                            <i class="${options.icon}"></i>
                            ${options.labelTitle}
                        </a-button>
                            {{/each}}

                            {{/if}}

                        </div>
                {{/if}}
    </script>
    <script id="fromcodetmpl" type="type/x-jquery-tmpl">
        {{each list}}
        {{if type == 'wmpDetail'}}
        <a-col :span="24">
            <a-table :data-source="formData.${options.controlId}" border style="width: 100%"  :columns="controlData.${options.controlId}.columns"
        :pagination="false" {{html options.tagattr}}>
                {{each options.columns}}

                {{/each}}
            </a-table>
        </a-col>
        ${setfromData(options,type,title)}
        {{else type == 'listview'}}
    <a-col :span="24">

            <div class="ant-table_container">
             <a-table :data-source="formData.${options.controlId}" border style="width: 100%" :columns="controlData.${options.controlId}.columns"
                 :pagination="false" {{html options.tagattr}}>
               {{each options.columns}}
                {{if typeof(isScopedSlots)!="undefined" && isScopedSlots==true}}
                {{tmpl($value) '#wmpDetailcodetmpl'}}
                {{/if}}
                {{/each}}
        </a-table>
           </div>
        {{if options.isPage==true}}
          <div class="ant-table_footer">
              <a-pagination
                :loading="controlData.${options.controlId}.pagination.isloading"
                v-model="controlData.${options.controlId}.pagination.currnet"
                :default-current="1"
                :total="controlData.${options.controlId}.pagination.total"
                show-quick-jumper
                @change="${options.controlId}handleTableChange"
                @showSizeChange="${options.controlId}showSizeChange"
                :pageSize="controlData.${options.controlId}.pagination.pagesize"
                show-size-changer
              />
              ${addhandleTableChange(options.controlId,options.sourceApiId)}
            </div>
        </a-col>
        {{/if}}

        ${setfromData(options,type,title)}

        {{else rowcontrolstr.indexOf(type + ',') >= 0}}
        <a-col :xs="${options.xs}"
        :md="${options.md}"
        :lg="${options.lg}" class="border-content" style="${getrowcontrolcss($value)}" >

                {{if type == 'imgage' }}
                <img data-v-6c4399d0=""
                     src="http://localhost:8080/file/downloadImg?path=AttachmentFile%5C2021-01-11-12-30%5Ca54eb02e-faca-46a4-8262-e8ea6cefa217.jpg"
                     width="150px"
                     height="80px" />
                {{else type == 'partlayout' }}
                         {{tmpl($value) '#fromcodetmpl'}}
                {{else type == 'upFilesComp' }}
                {{if options.uptype =='file'}}
                <upFilesComp :fileListArr="formData.${options.filed}"></upFilesComp>
                {{else options.uptype =='img'}}
                <upManyImgComp  :fileListArr="formData.${options.filed}" :limit="1"></upManyImgComp>
                {{else options.uptype =='arryimg'}}
                <upManyImgComp :fileListArr="formData.${options.filed}"
                ></upManyImgComp>
                {{/if}}
               ${setfromData(options,type,title)}
                {{/if}}
            </a-col>
        {{else type == 'button'}}
        <a-col :span="24" class="border-content">
            {{each options.buttons}}
            <a-button type="primary" style="margin-left:5px;    margin-top: 5px;" plain ${getevent($value)} {{html options.tagattr}}>
                <i class="${options.icon}"></i>
                &nbsp;
                ${options.labelTitle}
            </a-button>
            {{/each}}
        </a-col>
        {{else}}
    <a-col  :xs="${options.xs}"
    :md="${options.md}"
    :lg="${options.lg}"
            class="widget-view ${ type == 'textarea'||type == 'editor'?" border-mult":""}"
            style="padding:0px" class="border-content" style="${'height:'+(options.rowSpan !== undefined? 42 * options.rowSpan + 'px': '')}">
        ${setfromData(options,type,title)}
          {{if  typeof(title)!="undefined" && title != ''}}
            <label
              class="labeltitle ${ options.required == true?" required":"" }"
              style="width:${ options.labelwidth}px;" >
              ${ title }</label
            >
            {{/if}}
         <div
          style="${typeof(title)!="undefined" && title == ''?'':'margin-left: ' + options.labelwidth + 'px;'}"
        >
        {{if type == 'input'}}
        <a-input placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="formData.${options.filed}" maxlength="${options.dataLength}" ${getevent($value)} {{html options.tagattr}}></a-input>
        {{else type == 'textarea'}}
        <a-textarea  :rows="2"
                    placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="formData.${options.filed}" maxlength="${options.dataLength}" ${getevent($value)} {{html options.tagattr}}>
        </a-textarea>
        {{else type == 'editor'}}
        <Editor ref="${options.filed}"
                :value="formData.${options.filed}"></Editor>
        {{else type == 'select'}}
        <a-select style="width: 100%;" placeholder="请选择${ title }" ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}>
               {{if options.isRemote==true}}
               <a-select-option  v-for="(item,index) in controlData.${options.filed}" :key="index"
                          :value="item.${options.labelValue}">
            ${"{{item."+options.labelText}}}
                </a-select-option>
            {{else}}
              {{each options.options}}
                <a-select-option value="${value}">
                    ${label}
                </a-select-option>
                {{/each}}
            {{/if}}
        </a-select>
        {{else type == 'date'}}
        {{if options.modeltype == 'date'}}
        <a-date-picker placeholder="${options.placeholder}"
                       format="${options.format}"
                       ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />
        {{else options.modeltype == 'month'}}
        <a-month-picker placeholder="${options.placeholder}"
                        format="yyyy-MM"
                        ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />
        {{else options.modeltype == 'week'}}
        <a-week-picker placeholder="${options.placeholder}"
                       ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />
        {{else options.modeltype == 'range'}}
        <a-range-picker placeholder="${options.placeholder}"
                        format="${options.format}"
                        style="width:100%"
                        ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />
        {{/if}}
        {{else type == 'radio'}}
        <a-radio-group style="line-height:43px; display:block;" ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}>
              {{if options.isRemote==true}}
                   <a-radio  v-for="(item,index) in controlData.${options.filed}" :key="index"
                          :value="item.${options.labelValue}">
            ${"{{item."+options.labelText}}}
                </a-radio>
             {{else}}
                {{each options.options}}
                    <a-radio style="inline"
                                 label="${value}" >${label}</a-radio>
                    {{/each}}
            {{/if}}
        </a-radio-group>
        {{else type == 'checkbox'}}
        <a-checkbox-group
                           style="line-height:43px;" ${options.disabled?"disabled":""} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}>
             {{if options.isRemote==true}}
                   <a-checkbox  v-for="(item,index) in controlData.${options.filed}" :key="index"
                          :value="item.${options.labelValue}">
            ${"{{item."+options.labelText}}}
                </a-checkbox>
             {{else}}
                {{each options.options}}
                    <a-checkbox style="inline"
                                 label="${value}" >${label}</a-checkbox>
                    {{/each}}
            {{/if}}
        </a-checkbox-group>
        {{else type == 'editor'}}
           {{else type == 'switch'}}
              <a-switch
                v-model="formData.${options.filed}"
                active-color="${options.activecolor}"
                inactive-color="${options.inactivecolor}"
               ${options.disabled?"disabled":""}
              >
              </a-switch>
            {{else type == 'colorpicker'}}
           <el-color-picker
            v-model="formData.${options.filed}"
            ${options.disabled?"disabled":""}
            size="${options.butsize}"
          >
          </el-color-picker>
             {{else type == 'slider'}}
 <a-slider
            v-model="formData.${options.filed}"
           ${options.range?"range":""}
            :max="${options.max}"
            :min="${options.min}"
            :step="${options.step}"
          >
          </a-slider>
            {{else type == 'rate'}}
            <a-rate ${options.readonly?"readonly='true' ":" "}   v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}></a-rate>
        {{else type == 'blank'}}

        {{else type == 'rate'}}
        <a-rate ${options.readonly?"readonly='true' ":" "} v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}></a-rate>
        {{else type == 'inputnumber'}}
        <a-input-number ${options.disabled?"disabled":""}
                         min="${options.min}"
                         max="${options.max}"
                         step="${options.step}"
                         precision="${options.precision}" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}></a-input-number>
        {{else type == 'timepicker'}}
        <a-time-picker use12-hours
                       format="${options.timeformat}"
                       ${options.disabled?"disabled":""}
                       minute-step="${options.minute}"
                       second-step="${options.second}" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />

        {{else type == 'user'}}
        <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix" @click="$refs.${options.filed}dialog.visible = true"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
        <zhlDialog title="${options.precision}"
                   ref="${options.filed}dialog"
                   width="960px"
                   class="my-dialog">
            <selector :typemode="1"
                      @confirm="selector${options.filed}confirm"
                      @close="$refs.${options.filed}dialog.visible = false"></selector>
        </zhlDialog>
        ${addselectorconfirm(options.filed)}
        {{else type == 'department'}}
        <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix" @click="$refs.${options.filed}dialog.visible = true"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
        <zhlDialog title="${options.precision}"
                   ref="${options.filed}dialog"
                   width="960px"
                   class="my-dialog">
            <selector :typemode="2"
                      @confirm="selector${options.filed}confirm"
                      @close="$refs.${options.filed}dialog.visible = false"></selector>
        </zhlDialog>
        ${addselectorconfirm(options.filed)}
        {{else type == 'project'}}
        <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
        {{else type == 'cost'}}
        <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
        {{else type == 'choose'}}
        <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
        {{/if}}
        </div>
    </a-col>
        {{/if}}

        {{/each}}
    </script>
    <script id="buildactioncode" type="type/x-jquery-tmpl">
        ${key}(page){
         {{if controlType=='listview'}}
            this.controlData.${controlId}.pagination.isloading=true;
         {{/if}}
        const param=  {
        {{each paramlist}}
        {{if children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
        {{/if}}
        {{if $index<(children.length-1)}} ,
        {{/if}}
        {{/each}}
        };
        {{if type=='swagger'}}
          this.$ajaxswagger("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
          {{if controlType=='listview'}}
this.formData.${controlId}=res.${swaggerconfig.list};
         this.controlData.${controlId}.pagination.isloading=false;
        this.controlData.${controlId}.pagination.total=res.${swaggerconfig.totalcount};
          {{else}}
        this.controlData.${controlId}=res.${swaggerconfig.list};
    {{/if}}

                 });
           {{else}}
         {{if controlType=='listview'}}
         param.body.page=page;
         param.body.rows=this.controlData.${controlId}.pagination.pagesize;
        {{/if}}
         this.$apiComm("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
         {{if controlType=='listview'}}
        this.formData.${controlId}=res.data.list;
        this.controlData.${controlId}.pagination.isloading=false;
        this.controlData.${controlId}.pagination.total=res.totalcount;
        {{else}}
        this.controlData.${controlId}=res.data.list;
    {{/if}}
                 });
        {{/if}}
        }
    </script>
    <script id="buildactionItemcode" type="type/x-jquery-tmpl">
        {
        {{each children}}
        {{if variabletype=='Object' && children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
          {{if $index<(buildactionitem.children.length-1)}} ,
        {{/if}}
        {{else  paramvalue!=''}}
           {{if  paramvalue.indexOf('◇')>=0}}
            ${property}:"${paramvalue.substring(1,paramvalue.length)}"
           {{else  paramvalue.indexOf('◆')>=0}}
            ${property}:${paramvalue.substring(1,paramvalue.length)}
           {{else}}
           ${property}:this.formData.${paramvalue}
           {{/if}}
          {{if $index<(buildactionitem.children.length-1)}} ,
          {{/if}}
        {{/if}}

        {{/each}}
        }
    </script>
    <script id="buildAjaxcode" type="type/x-jquery-tmpl">
        const param=  {
        {{each paramlist}}
        {{if children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
        {{/if}}
        {{if $index<(children.length-1)}} ,
        {{/if}}
        {{/each}}
        };
        {{if type=='swagger'}}
          this.$ajaxswagger("${sourceApi}",param).then(res=>{
            if(res.code!=0){
            this.$message.error(res.msg);
            }

                 });
           {{else}}
         this.$apiComm("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
                 });
        {{/if}}
    </script>
    <div id="buildcode"></div>
    <script type="text/javascript">
        var swaggerconfig = {};
        var formData = {};
        var controlData = {};
        var eventdatafunction = {};
        var jsobject = {};
        var rules = {};
        var rowcontrolstr = 'tree,navmenu,blank,partlayout,dynamiclayout,calendar,imgage,upFilesComp,upImgComp,upManyImgComp'; ///占整行的控件
        var dynamicheight = 'partlayout,tree,calendar,imgage,upFilesComp,'; ///由内部控件撑高度的控件
        var minheight = 'partlayout,dynamiclayout,'
        var buildactionitem = {};
        var actionfunstr = "";
        function setbuildactionitem(item) {
            buildactionitem = item;
            return "";
        }
        ///大小写问题 需要替换
        var casestring = {
            zhldialog: 'zhlDialog',
            upfilescomp: 'upFilesComp',
            upimgcomp: 'upImgComp',
            upmanyimgcomp: 'upManyImgComp',
            editor: 'Editor',
            showsizechange: 'showSizeChange'
        }
        function getStorageValue(key) {
            var strStorage = localStorage.getItem(key);
            if (strStorage == null) {
                strStorage = sessionStorage.getItem(key)
            }
            if (strStorage != null) {
                var obj = JSON.parse(strStorage);
                var content = {};
                if (obj.dataType === 'string') {
                    content = obj.content
                } else if (obj.dataType === 'number') {
                    content = Number(obj.content)
                } else if (obj.dataType === 'boolean') {
                    /* eslint-disable */
                    content = eval(obj.content)
                } else if (obj.dataType === 'object') {
                    content = obj.content
                }
                return content;
            }
        }
        function buildpubish(frominfo, jscode) {
            rules = {};
            swaggerconfig = getStorageValue("swaggerconfig");
            actionfunstr = "";
            var isError = loadjscode(jscode);
            if (isError == false) {
                return false;
            }
            var htmlcode = $("#miantmpl").tmpl(frominfo).prop("outerHTML");
            for (var key in casestring) {
                var reg = new RegExp(key, "g");
                htmlcode = htmlcode.replace(reg, casestring[key]);
            }
            //  htmlcode = style_html(htmlcode, tabsize, tabchar, 80);
            var jscode = bulidjscode(frominfo);
            isError = loadjscode(jscode);
            if (isError == false) {
                return false;
            }
            //   jscode = jsbeautify(jscode);
            var buildObject = {
                htmlcode: htmlcode,
                jscode: "export default " + jscode,
                csscode: getcss()
            };
            return buildObject;
        }
        function loadjscode(jscode) {
            eventdatafunction = {};
            formData = {};
            controlData = {};
            jsobject = {
                data() {
                    return {}
                }, methods: {}
            }
            if (jscode != undefined && jscode != "") {
                try {
                    jsobject = eval("(" + jscode.replace('export default', '') + ")");
                } catch {
                    return false
                }
                if (jsobject.methods != undefined) {
                    eventdatafunction = Object.assign(jsobject.methods)
                }
            }
            return true
        }

        function bulidjscode() {
            var jscode = "";
            var newjsdata = Object.assign(jsobject.data());
            newjsdata["formData"] = formData;
            newjsdata["rules"] = rules;
            newjsdata["controlData"] = controlData;
            var methodseventfunction = "";

            /////生成Actionfun 方法
            //for (var key in frominfo.actionfun) {
            //    var item = frominfo.actionfun[key];
            //    item.key = key;
            //    $("#buildcode").html('');
            //    $("#buildactioncode").tmpl(item).appendTo("#buildcode");
            //    eventdatafunction[key] = $("#buildcode").html().replace(/&gt;/g, ">");
            //    actionfunstr = actionfunstr + `${key}(1);`
            //}
            eventdatafunction["funmounted"] = `\n//系统方法页面加载方法 \n funmounted(){${actionfunstr}}`
            for (var key in eventdatafunction) {
                methodseventfunction = methodseventfunction == "" ? eventdatafunction[key].toString() : methodseventfunction + "," + eventdatafunction[key].toString();
            }
            jscode = jscode + "{";
            for (key in jsobject) {
                var codestr = jscode == "{" ? "" : ",";
                if (key == "data" && typeof (jsobject[key]) == "function") {
                    jscode = jscode + codestr + " data(){ return " + JSON.stringify(newjsdata) + "} ";
                } else if (typeof (jsobject[key]) == "function") {
                    jscode = jscode + codestr + jsobject[key].toString();
                } else if (key == "methods" && typeof (jsobject[key]) == "object") {
                    jscode = jscode + codestr + " methods:{" + methodseventfunction + "} ";
                } else if (typeof (jsobject[key]) == "object") {
                    if (jsobject[key] instanceof Array) {
                        jscode = jscode + codestr + " " + key + ":[" + bulidobject(jsobject[key]) + "] ";
                    } else {
                        jscode = jscode + codestr + " " + key + ":{" + bulidobject(jsobject[key]) + "} ";
                    }
                } else if (typeof (jsobject[key]) != "undefined") {
                    jscode = jscode + codestr + " " + key + ":'" + jsobject[key].toString().replace(/\"/g, "\\\"") + "'";
                }
            }
            if (jsobject["mounted"] == undefined || jsobject["mounted"] == null) {
                jscode = jscode + `,mounted(){this.funmounted();}`;
            }
            jscode = jscode + "}";
            return jscode;
        }
        function bulidobject(obj) {
            var jscode = "{";
            for (key in obj) {
                var codestr = jscode == "{" ? "" : ",";
                if (key == "formData") {
                    jscode = jscode + codestr + " " + key + ":'" + JSON.stringify(obj[key]) + "'";
                } else if (typeof (obj[key]) == "function") {
                    jscode = jscode + codestr + obj[key].toString();
                } else if (typeof (obj[key]) == "object") {
                    if (obj[key] instanceof Array) {
                        jscode = jscode + codestr + key + ":[" + bulidobject(obj[key]) + "]";
                    } else {
                        jscode = jscode + codestr + key + ":{" + bulidobject(obj[key]) + "}";
                    }
                } else if (typeof (obj[key]) != "undefined") {
                    jscode = jscode + codestr + key + ":'" + obj[key].toString().replace(/\"/g, "\\\"") + "'";
                }
            }
            jscode = jscode + "}";
            return jscode
        }
        function getrowcontrolcss(element) {
            var cssstr = "padding:0px";
            cssstr = cssstr + (minheight.indexOf(element.type + ',') == 0 ? 'min-height:42px' : '');
            cssstr = cssstr + dynamicheight.indexOf(element.type + ',') >= 0 ? 'height:auto' : (element.options.rowSpan !== undefined ? "height" + element.options.rowSpan * 42 + 'px' : 'height:auto');
            return cssstr;
        }

        function getevent($obj) {
            var eventcode = "";
            if ($obj.eventlist == undefined) {
                return eventcode;
            }
            for (var i = 0; i < $obj.eventlist.length; i++) {
                if ($obj.eventlist[i].value != "" && $obj.eventlist[i].value != undefined) {
                    eventcode = eventcode + " @" + $obj.eventlist[i].label + '=' + $obj.eventlist[i].value + '';
                    if ($obj.eventlist[i].value.indexOf("(") < 0) {
                        if (eventdatafunction[$obj.eventlist[i].value] == undefined) {
                            eventdatafunction[$obj.eventlist[i].value] ="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+  $obj.eventlist[i].value + "() { }";
                        }else{
                            eventdatafunction[funname]="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+eventdatafunction[funname]
                        }
                    } else {
                        var funname = $obj.eventlist[i].value;
                        funname = funname.substring(0, $obj.eventlist[i].value.indexOf("("));
                        if (eventdatafunction[funname] == undefined) {
                            var funparamstr = $obj.eventlist[i].value.replace(funname + "(", "").replace(")", "").split(",");
                            var funname = funname + "(";
                            if (funparamstr[0] != "") {
                                for (var i = 0; i < funparamstr.length; i++) {
                                    if (i == 0) {
                                        funname = funname + "param" + i;
                                    } else {
                                        funname = funname + ",param" + i;
                                    }
                                }
                            }
                            funname = funname + ")"
                            eventdatafunction[funname] ="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+  funname + "{ }";
                        }else{
                            eventdatafunction[funname]="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+eventdatafunction[funname]
                        }
                    }
                }
            }
            return eventcode;
        }
        ///选人选部门 点击确定事件
        function addselectorconfirm(filed) {
            var funname = `selector${filed}confirm`;
            if (eventdatafunction[funname] == undefined) {
                eventdatafunction[funname] = funname + `(selectlist) { \r\n this.formData.${filed}.text="";\n\r this.formData.${filed}.value=[]; \n\r for (let i = 0; i < selectlist.length; i++) {
                                                     this.formData.${filed}.text=this.formData.${filed}.text==""?selectlist[i].Name:this.formData.${filed}.text+";"+selectlist[i].Name;\n\r  this.formData.${filed}.value.push(selectlist[i]);\n\r
                                                    }\n\r
                                            this.$refs.${filed}dialog.visible = false;\n\r
                                            }\n\r`;
            }
            return "";
        }
        function addhandleTableChange(controlId, sourceApiId) {
            var handlefunname = `${controlId}handleTableChange`;
            var showSizefunname = `${controlId}showSizeChange`;
            if (eventdatafunction[handlefunname] == undefined) {
                eventdatafunction[handlefunname] = `${controlId}handleTableChange(pagination) {
                                                                    this.${sourceApiId}(pagination)
                                                                }`
            }
            if (eventdatafunction[showSizefunname] == undefined) {
                eventdatafunction[showSizefunname] = `${controlId}showSizeChange(page, pageSize) {
this.controlData.${controlId}.pagination.pagesize=pageSize;
                                                                    this.${sourceApiId}(1)
                                                                }`
            }
            return "";
        }

        ///生成fromdata 结构
        function setfromData(options, type, title) {
            if (type == "listview") {
                if (options.controlId != undefined) {
                    if (formData[options.controlId] == undefined) {
                        formData[options.controlId] = []
                        formData["del" + options.controlId] = []
                        //if (options.sourceApi != undefined && options.sourceApi != '' && options.sourceApi.indexOf('/') < 0) {
                        controlData[options.controlId] = {};
                        controlData[options.controlId]["queryparam"] = {}
                        controlData[options.controlId]["scopedSlots"] = []
                        controlData[options.controlId]["pagination"] = { currnet: 1, total: 0, pagesize: 10, isloading: false }
                        controlData[options.controlId].columns = []
                        for (var i = 0; i < options.columns.length; i++) {
                            var columnitem = options.columns[i];
                            if (columnitem.type == "showno") {
                                //controlData[options.controlId].columns.push({
                                //     title: columnitem.name,
                                //     width: 60,
                                //     customRender: (value,row,index) => {
                                //         return {
                                //             children: ((this.pagination.current - 1) * this.pagination.pageSize - index + 1)
                                //         };
                                //     }
                                // });
                            } else {
                                controlData[options.controlId].columns.push({
                                    title: columnitem.options.title,
                                    dataIndex: columnitem.dataIndex,
                                    width: 150,
                                    scopedSlots: { customRender: columnitem.dataIndex },
                                    align: 'center'
                                });
                            }
                            if (columnitem.options != null && columnitem.options.filed != "" && columnitem.options.filed != undefined) {
                                rules[columnitem.options.filed] = []
                                if (columnitem.options.ruleslist != undefined) {
                                    rules[columnitem.options.filed] = JSON.parse(JSON.stringify(columnitem.options.ruleslist));
                                }
                                if (columnitem.options.required == true) {
                                    rules[columnitem.options.filed].push({
                                        required: true,
                                        message: columnitem.title + '必填',
                                        trigger: 'blur'
                                    });
                                }

                            }

                        }
                    }
                }
            }
            else if ('upFilesComp' == type) {
                if (options.filed != undefined) {
                    if (formData[options.filed] == undefined) {
                        formData[options.filed] = []
                    }
                }
            } else if ("user,department,project,cost,choose".indexOf(type) >= 0) {
                if (options.filed != undefined) {
                    if (formData[options.filed] == undefined) {
                        formData[options.filed] = { text: "", value: [] }
                    }
                }
            } else {
                if (options.filed != undefined) {
                    if (options.defaultValue != undefined) {
                        formData[options.filed] = options.defaultValue;
                    } else {
                        formData[options.filed] = "";
                    }
                }
            }
            if (options.sourceApiId != undefined && options.source.type != undefined && options.source.type != undefined) {
                options.source.controlType = type;
                options.source.key = options.sourceApiId;
                options.source.controlId = options.filed == undefined ? options.controlId : options.filed;
                options.source.isPage = options.isPage;
                $("#buildcode").html('');
                $("#buildactioncode").tmpl(options.source).appendTo("#buildcode");
                eventdatafunction[options.sourceApiId] = $("#buildcode").html().replace(/{controlId}/g, options.source.controlId).replace(/&gt;/g, ">");
                actionfunstr = actionfunstr + `this.${options.sourceApiId}(1);`
                if (type != 'listview') {
                    controlData[options.source.controlId] = [];
                }
            }
            if (options.filed != undefined) {
                rules[options.filed] = []
                if (options.ruleslist != undefined) {
                    rules[options.filed] = JSON.parse(JSON.stringify(options.ruleslist));
                }
                if (options.required) {
                    rules[options.filed].push({
                        required: true,
                        message: title + '必填',
                        trigger: 'blur'
                    });
                }
            }
            return "";
        }

        function buildsource(source) {
            $("#buildcode").html('');
            $("#buildAjaxcode").tmpl(source).appendTo("#buildcode");
            return $("#buildcode").html().replace(/&gt;/g, ">");
        }
        function getcss() {
            return $("#commoncss").html();
        }
    </script>
    <style id="commoncss">
        .labeltitle {
            vertical-align: middle;
            float: left;
            font-size: 14px;
            color: #606266;
            line-height: 30px;
            /* padding: 0 12px 0 0; */
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            font-weight: normal;
        }

        .border-title {
            height: 42px;
            line-height: 42px;
            padding-left: 15px;
            border-top: none;
            border-right: none;
        }

        .border-content {
            border-top: none;
            border-right: none;
            padding-right: 15px;
            padding-left: 15px;
            padding-top: 0px;
            padding-bottom: 4px;
            height: 42px;
        }

        .border-mult .border-content {
            padding-top: 4px;
            height: auto;
            border-bottom: none;
        }

        .border-mult .border-title {
            height: auto;
            border-bottom: none;
            border-left: none;
            margin-left: -2px;
        }

        .required:before {
            content: '*';
            color: #c80000;
            font-size: 12px;
            vertical-align: top;
            display: inline-block;
            width: 10px;
            height: 10px;
            top: 2px;
            margin-left: -9px;
        }

        .el-input__inner {
            height: 35px;
            line-height: 35px;
        }
    </style>
</body>

</html>
